<template>
    <div>
        <div>姓：<input type="text" v-model="firstName"></div>
        <div>名：<input type="text" v-model="lastName"></div>
        <div>全名：{{ fullName }}</div>
    </div>
</template>

<script setup lang="ts" name="car">
   import { ref,computed } from "vue";
   let firstName = ref("张")
   let lastName = ref("三")
   let fullName = computed(()=>{
     return   firstName.value.slice(0,1).toUpperCase()+firstName.value.slice(1)+ '-' + lastName.value
   })
</script>

<style></style>